//
//  WebService.h
//  iSeal6100
//
//  Created by He Yuan on 13-1-25.
//  Copyright (c) 2013年 http://www.heyuan110.com. All rights reserved.
//

#import <Foundation/Foundation.h>

//请求成功
typedef void (^RequestSuccessBlock)(NSDictionary *respInfo,NSError *error);

//请求失败
typedef void (^RequestFailureBlock)(id info,NSError *error);

//----------ALL API------------

//我型我秀列表请求
static NSString *const APIEveryOneList = @"everyone_list_get";

//我型我秀列表请求
static NSString *const APIZhuanYeList = @"zhuanye_list_get";

//获取用户首页信息请求
static NSString *const APIUserHome = @"user_home_get";

//用户注册请求
static NSString *const APIUserRegister = @"user_register_set";

//用户登陆请求
static NSString *const APIUserLogin = @"user_login_get";

//设置用户头像
static NSString *const APISetUserAvatar = @"avatar_save_set";

//更新用户资料
static NSString *const APIUserInfoSet = @"user_info_set";

//扮美DIY
static NSString *const APIDIYList = @"diy_list_get";

//搜索|查价位
static NSString *const APISearch = @"user_search_get";

//加关注
static NSString *const APIFollow = @"user_follow_set";

//取消关注
static NSString *const APIUnFollow = @"user_follow_del";

//获取我的私信
static NSString *const APIPrivateMessage = @"user_msg_list_get";

//获取私信详细
static NSString *const APIGetPrivateMessageDetail = @"user_msg_get";

//发送私信
static NSString *const APISendPrivateMessage = @"user_msg_set";

//发送私信时发送图片
static NSString *const APISendPrivateImageMessage = @"image_save_set";

//上传完图片后分享图片
static NSString *const APIShareUploadImage = @"share_save_set";

//获取最新版本
static NSString *const APIGetLastestVersion = @"soft_version_get";

//修改密码
static NSString *const APIUpdatePassword = @"user_password_set";

//喜欢/收藏
static NSString *const APILikeAndFavorite = @"share_fav_set";

//分享评论列表
static NSString *const APICommentList = @"user_share_comment_get";

//发布评论
static NSString *const APISendComment = @"user_share_comment_set";

//获取收藏列表
static NSString *const APIGetFavoritesList = @"share_fav_get";


@interface WebService : NSObject

+(NSError *)configError:(NSInteger)errorcode;

+(NSError *)configError:(NSInteger)errorcode msg:(NSString *)msg;

//GET REQUEST
+(void)getRequestAction:(NSString *)action
                  param:(NSDictionary *)p
                success:(RequestSuccessBlock)sblock
                failure:(RequestFailureBlock)fblock
               progress:(UIView *)v;

+(void)cancelRequest:(NSString*)m;

+(void)cancelAllRequest;

//上传图像
+(void)uploadImage:(UIImage *)uploadImage
             param:(NSDictionary *)p
         labelText:(NSString *)txt
           success:(RequestSuccessBlock)sblock
           failure:(RequestFailureBlock)fblock;

@end
